package net.mcreator.mcreatordetector.procedures;

import net.neoforged.fml.ModList;
import net.neoforged.neoforgespi.language.IModInfo;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class GetAllMCRModProcedure {
	public static List<String> execute() {
		var m = new ArrayList<String>();
		for(IModInfo info: ModList.get().getMods()){
			if(Objects.equals(info.getModId(), "mcreator_detector")){continue;}
			if(IsMCRModProcedure.execute(info.getModId()) || HasMCRDirProcedure.execute(info.getModId())){
				m.add(info.getModId());
			}
		}
		if(ISAprilFoolsDayProcedure.execute()){
			m.addFirst("mcreator_detector");
		}
		return m;
	}
}